package cc.miwuya.property.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cc.miwuya.property.domain.MeterItem;
import cc.miwuya.property.service.MeterItemService;
import cc.miwuya.property.mapper.MeterItemMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 杩烽浘妫灄
* @description 针对表【meter_item(计量表详情)】的数据库操作Service实现
* @createDate 2024-02-22 19:49:08
*/
@Service
public class MeterItemServiceImpl extends ServiceImpl<MeterItemMapper, MeterItem>
    implements MeterItemService{

    @Override
    public List<MeterItem> getByMeterId(Long id) {
        //根据传入的id获取meterItem表中符合要求的最后一条数据
        return list(new QueryWrapper<MeterItem>().eq("meter_id",id).orderByDesc("id").last("limit 1"));
    }
}




